﻿using System;
using System.Collections.Generic;
using System.Linq;
using HumanResorcesProj.DAL._HR_DSTableAdapters;
using HumanResorcesProj.DAL;
using System.Web;

namespace HumanResorcesProj.BLL
{
    public class Emp
    {
        private EmpPersonalInfoTableAdapter info = null;
        public EmpPersonalInfoTableAdapter adapter
        {
            get
            {
                if (info == null) info = new EmpPersonalInfoTableAdapter();
                return info;
            }
        }


        public DAL._HR_DS.EmpPersonalInfoDataTable getData()
        {
            return adapter.GetData();
        }

        public DAL._HR_DS.EmpPersonalInfoDataTable UserGetByName(string EmpID)
        {
            return adapter.GetByID(EmpID);
        }

        public void InsertNewEmp(string EmpName, string EmpFamily, string EmpID, string EmpAddress, string EmpGender, string EmpMaritalStatus, string EmpBirthDate, string EmpWorkDate, string EmpWorkStatus, string EmpWorkEndDate, string WorkMobile, string PersonalMobile, string HomePhone, string EmailAddress1, string EmailAddress2, string Projectkey, string EmpWorkRol, string JobPercentage, string PoolHour, string PoolHourType, string Wage, string WageMethod, bool GotPhone, bool GotAshel, bool AdvancedStudy, bool TravelPayment, string EmployeePension, string employerPension, string OffsetExemptions, string ProvidentFund, string SubProj, string EmpChildNum, string EmpWageContract, string TravelMethodType, string GotPhoneDetail, string GotAshelDetail, string AdvancedStudyDetail)
        {
            SubProj = GUI.AddNewEmployee.SubProj;
            EmpChildNum = "0";
            adapter.InsertNewEmp(EmpName, EmpFamily, EmpID, EmpAddress, EmpGender, EmpMaritalStatus, EmpBirthDate, EmpWorkDate, EmpWorkStatus, EmpWorkEndDate, WorkMobile,PersonalMobile, HomePhone, EmailAddress1, EmailAddress2, Projectkey, EmpWorkRol, JobPercentage, PoolHour, PoolHourType, Wage, WageMethod, GotPhone, GotAshel, AdvancedStudy, TravelPayment, EmployeePension, employerPension, OffsetExemptions, ProvidentFund, SubProj, EmpChildNum, EmpWageContract, TravelMethodType, GotPhoneDetail, GotAshelDetail, AdvancedStudyDetail);

        }
            
        public void UpdateChildNum(string EmpID, int EmpChildNum)
        {
           // EmpID = "111111118";
            //EmpChildNum = 7;
            adapter.UpdateChildNum(EmpChildNum,EmpID);
        }


    }
}
